
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>0.6 Logging in and Transferring Files via SSH · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-panel/icons.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-panel/panel.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="0.7.html" />
    
    
    <link rel="prev" href="0.5.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    课程设计介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../read-before-starting.html">
            
                <a href="../read-before-starting.html">
            
                    
                    实验前必读
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="./">
            
                <a href="./">
            
                    
                    PA0 - 开发环境配置
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="0.1.html">
            
                <a href="0.1.html">
            
                    
                    0.1 Installing a GNU/Linux VM
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="0.2.md">
            
                <span>
            
                    
                    0.2 First Step into Linux
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="0.3.md">
            
                <span>
            
                    
                    0.3 Installing Basic Tools
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="0.4.html">
            
                <a href="0.4.html">
            
                    
                    0.4 Installing More Tools
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="0.5.html">
            
                <a href="0.5.html">
            
                    
                    0.5 More Exploration
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.3.6" data-path="0.6.html">
            
                <a href="0.6.html">
            
                    
                    0.6 Logging in and Transferring Files via SSH
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="0.7.html">
            
                <a href="0.7.html">
            
                    
                    0.7 Acquiring Source Code for PAs
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../pa1/">
            
                <a href="../pa1/">
            
                    
                    PA1 - 最简单的计算机
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../pa1/1.1.html">
            
                <a href="../pa1/1.1.html">
            
                    
                    1.1 简易调试器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../pa1/1.2.html">
            
                <a href="../pa1/1.2.html">
            
                    
                    1.2 表达式求值
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../pa1/1.3.html">
            
                <a href="../pa1/1.3.html">
            
                    
                    1.3 监视点
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../pa2/">
            
                <a href="../pa2/">
            
                    
                    PA2 - 冯诺依曼计算机
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../pa2/2.1.html">
            
                <a href="../pa2/2.1.html">
            
                    
                    2.1 第一个程序
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../pa2/2.2.html">
            
                <a href="../pa2/2.2.html">
            
                    
                    2.2 基本指令集
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../pa2/2.3.html">
            
                <a href="../pa2/2.3.html">
            
                    
                    2.3 输入输出
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../pa3/">
            
                <a href="../pa3/">
            
                    
                    PA3 - 异常和分页
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../pa3/3.1.html">
            
                <a href="../pa3/3.1.html">
            
                    
                    3.1 异常控制流
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../pa3/3.2.html">
            
                <a href="../pa3/3.2.html">
            
                    
                    3.2 虚拟地址空间
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../pa4/">
            
                <a href="../pa4/">
            
                    
                    PA4 - 分时多任务
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../pa4/4.1.html">
            
                <a href="../pa4/4.1.html">
            
                    
                    4.1 上下文切换
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../pa4/4.2.html">
            
                <a href="../pa4/4.2.html">
            
                    
                    4.2 时钟中断
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../lab3.html">
            
                <a href="../lab3.html">
            
                    
                    Lab3 - Cachesim
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../问题汇总/">
            
                <a href="../问题汇总/">
            
                    
                    问题汇总
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../问题汇总/PA0.html">
            
                <a href="../问题汇总/PA0.html">
            
                    
                    PA0
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../问题汇总/PA1.html">
            
                <a href="../问题汇总/PA1.html">
            
                    
                    PA1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="../问题汇总/PA2.html">
            
                <a href="../问题汇总/PA2.html">
            
                    
                    PA2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4" data-path="../问题汇总/PA3.html">
            
                <a href="../问题汇总/PA3.html">
            
                    
                    PA3
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" >
            
                <span>
            
                    
                    评分细则
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="ScoringRule0.html">
            
                <a href="ScoringRule0.html">
            
                    
                    PA0评分细则
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../pa1/ScoringRule1.1.html">
            
                <a href="../pa1/ScoringRule1.1.html">
            
                    
                    PA1.1评分细则
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.3" data-path="../pa1/ScoringRule1.2&1.3.html">
            
                <a href="../pa1/ScoringRule1.2&1.3.html">
            
                    
                    PA1.2&1.3评分细则
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.4" data-path="../pa2/ScoringRule2.1.html">
            
                <a href="../pa2/ScoringRule2.1.html">
            
                    
                    PA2.1评分细则
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.5" data-path="../pa2/ScoringRule2.2&2.3.html">
            
                <a href="../pa2/ScoringRule2.2&2.3.html">
            
                    
                    PA2.2&2.3评分细则
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.6" data-path="../pa3/ScoringRule3.1.html">
            
                <a href="../pa3/ScoringRule3.1.html">
            
                    
                    PA3.1评分细则
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.7" data-path="../pa3/ScoringRule3.2.html">
            
                <a href="../pa3/ScoringRule3.2.html">
            
                    
                    PA3.2评分细则
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../others/">
            
                <a href="../others/">
            
                    
                    杂项
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="../others/submit-requirement.html">
            
                <a href="../others/submit-requirement.html">
            
                    
                    实验提交要求
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2" data-path="../others/git-manual.html">
            
                <a href="../others/git-manual.html">
            
                    
                    Git 入门教程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.3" data-path="../others/linux-manual.html">
            
                <a href="../others/linux-manual.html">
            
                    
                    Linux 入门教程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.4" data-path="../others/man-manual.html">
            
                <a href="../others/man-manual.html">
            
                    
                    Man 入门教程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.5" data-path="../others/markdown-manual.md">
            
                <span>
            
                    
                    Markdown 入门教程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.6" data-path="../others/instruction-example.html">
            
                <a href="../others/instruction-example.html">
            
                    
                    指令执行示例
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.7" data-path="../others/how-to-read-i386.html">
            
                <a href="../others/how-to-read-i386.html">
            
                    
                    i386 手册阅读指南
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.8" data-path="../others/i386-typo.html">
            
                <a href="../others/i386-typo.html">
            
                    
                    i386 手册勘误
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.9" data-path="../others/software-suggest.html">
            
                <a href="../others/software-suggest.html">
            
                    
                    软件推荐
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >0.6 Logging in and Transferring Files via SSH</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="logging-in-and-transferring-files-via-ssh">Logging in and Transferring Files via SSH</h1>
<p><div class="panel panel-info"><div class="panel-heading"><div class="panel-icon"><i class="icon-info"></i></div><div class="panel-title">What you should do in this section</div></div><div class="panel-content"><ol>
<li>Read the whole text carefully.</li>
<li>Try the commands of Linux mentioned.</li>
<li>Download and install some necessary tools.</li>
<li>Try operations of logging and file transferring mentioned by yourself.</li>
<li>Answer all the questions given in the quoting part.</li>
</ol>
</div></div></p>
<p>Since there is one terminal with small size in the VM, it is not very convenient to use. Therefore, we recommend you to log in the VM via SSH.</p>
<h3 id="for-linux-users">For Linux Users</h3>
<p>You can do experiments directly under the environment of physically installed Linux, not need to use SSH to connect the virtual machine.</p>
<h3 id="for-mac-users">For Mac Users</h3>
<p>You will use the build-in <code>ssh</code> tool, and do not need to install an extra one. Open a terminal, run</p>
<pre><code class="lang-bash">ssh -pXXXX username@127.0.0.1
</code></pre>
<p>where <code>username</code> is your VM user name, <code>XXXX</code> is the Host Port number you have set in the Port Forwarding . For example:</p>
<pre><code class="lang-bash">ssh -p22 jack@127.0.0.1
</code></pre>
<p>If you are prompted with</p>
<pre><code>Are you sure you want to continue connecting (yes/no)?
</code></pre><p>enter &quot;yes&quot;. Then enter your VM user password. If everything is fine, you will access the VM via SSH successfully. To exit SSH, just type</p>
<pre><code class="lang-bash"><span class="hljs-built_in">exit</span>
</code></pre>
<p>in terminal.</p>
<h3 id="for-windows-users">For Windows Users</h3>
<p>Windows has no build-in <code>ssh</code> tool, and you have to download one manually. Download the <strong>latest release version</strong> of <code>putty.exe</code> <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html" target="_blank">here</a>. Run <code>putty.exe</code>, and you will see a dialog is invoked. In the input box labeled with <code>Host Name (or IP address)</code>, enter the IP address mentioned above. Leave other settings default, then click <code>Open</code> button. Enter your VM user name and password. If everything is fine, you will access the VM via SSH successfully. To exit SSH, just type</p>
<pre><code class="lang-bash"><span class="hljs-built_in">exit</span>
</code></pre>
<p>in terminal.</p>
<h2 id="transferring-files-between-hosts">Transferring Files between Hosts</h2>
<p>Although VM is running on the host, they are isolated logically. This means the host can not directly access files in the VM, and vice versa. Therefore, a way is needed to transfer files from/to the VM. In most circumstances, you need to export the codes you wrote in the virtual machine or transfer some necessary files into the VM. This section will tell you how to do that.</p>
<h3 id="for-linux-users">For Linux Users</h3>
<p>You can do experiments directly under the environment of physically installed Linux, not need to use SSH to transfer files to/from the virtual machine.</p>
<h3 id="for-mac-users">For Mac Users</h3>
<p>Thanks to Unix Philosophy, you can use one command to achieve the transferring.</p>
<p>To transfer files from host to VM, issue the following command in the host:</p>
<pre><code class="lang-bash">tar cj file | ssh username@127.0.0.1 <span class="hljs-string">&apos;tar xvjf -&apos;</span>
</code></pre>
<p>where <code>file</code> is the file to transfer in the host, <code>username</code> is the same as mentioned in the Logging in via SSH section. You will be asked to enter your VM user password. If everything is fine, the <code>file</code> will be transferred to the home directory of the VM.</p>
<p>To transfer files from VM to host, issue the following command in the host:</p>
<pre><code class="lang-bash">ssh username@127.0.0.1 <span class="hljs-string">&apos;tar cj file&apos;</span> | tar xvjf -
</code></pre>
<p>where <code>file</code> is the file to transfer in the VM, <code>username</code> is the same as mentioned in the Host Configuration section above. You will be asked to enter your VM user password. If everything is fine, the <code>file</code> will be transferred to the home directory of the host.</p>
<h4 id="for-windows-users">For Windows Users</h4>
<p>You can either use the <strong>latest release version</strong> of <code>psftp.exe</code> <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html" target="_blank">here</a> which is just a command line program in Windows. Or we recommend you to use other tools like <a href="https://filezilla-project.org/" target="_blank">FileZilla</a> to establish the SSH file transfer protocol.</p>
<h5 id="psftp">PSFTP</h5>
<p>Run <code>psftp.exe</code>, and connect to the VM by the following command:</p>
<pre><code>open ip_addr
</code></pre><p>where <code>ip_addr</code> is the same as mentioned in the Host Configuration section. Then enter your VM user name as well as the password, as if logging in via <code>ssh</code>. We list some useful commands in <code>psftp.exe</code>:</p>
<pre><code>cd     change your remote working directory
exit   finish your SFTP session
get    download a file from the server to your local machine
help   give help
lcd    change local working directory
lpwd   print local working directory
ls     list remote files
put    upload a file from your local machine to the server
pwd    print your remote working directory
</code></pre><p>Under our situation, &quot;local machine&quot; stands for the host, &quot;server&quot; and &quot;remote&quot; stand for the VM. For more details about the command, refer to <code>help COMMAND</code>.</p>
<h5 id="filezilla">FileZilla</h5>
<ol>
<li>Run <code>FileZilla Client</code>.</li>
<li>Type the IP address at the <code>Host</code> entry like: <code>sftp://ip_addr</code>, note that <code>sftp://</code> is needed.</li>
<li>Type your username and password in the following textboxes and click <code>Quickconnect</code>.</li>
<li>A box of <code>Unknown host key</code> will appear and you should check <code>Always trust this host, add this key to the cache</code> to prevent it from appearing again next time.</li>
<li>If everything goes correctly, the connection will be established and you can see all the files in the VM.</li>
<li>Enjoy transferring files between VM and host!</li>
</ol>
<p><div class="panel panel-success"><div class="panel-heading"><div class="panel-icon"><i class="icon-success"></i></div><div class="panel-title">Have a try!</div></div><div class="panel-content"><ol>
<li>New a text file with casual contents in the host.</li>
<li>Transfer the text file to the VM.</li>
<li>Modify the content of the text file in the VM.</li>
<li>Transfer the modified file back to the host.</li>
</ol>
<p>Check whether the content of the modified file you get after the last step is expected. If it is the case, you are done!</p>
</div></div></p>
<p><div class="panel panel-danger"><div class="panel-heading"><div class="panel-icon"><i class="icon-danger"></i></div><div class="panel-title">&#x4E0D;&#x8981;&#x628A;&#x6574;&#x4E2A;&#x9879;&#x76EE;&#x5728;&#x865A;&#x62DF;&#x673A;&#x548C;&#x5BBF;&#x4E3B;&#x673A;&#x4E4B;&#x95F4;&#x6765;&#x56DE;&#x4F20;</div></div><div class="panel-content"><p>&#x4E0B;&#x4E00;&#x9636;&#x6BB5;&#x6211;&#x4EEC;&#x5C06;&#x4F1A;&#x83B7;&#x5F97;&#x6574;&#x4E2A;&#x9879;&#x76EE;&#x7684;&#x4EE3;&#x7801;&#x3002;&#x8BF7;&#x6CE8;&#x610F;&#xFF0C;&#x5728;&#x4EE5;&#x540E;&#x7684;&#x4EFB;&#x52A1;&#x4E2D;&#xFF0C;&#x4E0D;&#x8981;&#x5728;&#x5BBF;&#x4E3B;&#x673A;&#x4FEE;&#x6539;&#x597D;&#x4E86;&#x4EE3;&#x7801;&#x4E4B;&#x540E;&#xFF0C;&#x628A;&#x6574;&#x4E2A;&#x9879;&#x76EE;&#x4F20;&#x5230;&#x865A;&#x62DF;&#x673A;&#x4E2D;&#x8986;&#x76D6;&#x539F;&#x9879;&#x76EE;&#xFF0C;&#x8FD9;&#x4F1A;&#x9020;&#x6210;&#x8BB8;&#x591A;&#x4E0D;&#x53EF;&#x633D;&#x56DE;&#x7684;&#x95EE;&#x9898;&#x3002;&#x8BF7;&#x5927;&#x5BB6;&#x6700;&#x597D;&#x4F7F;&#x7528;vim&#x76F4;&#x63A5;&#x5728;&#x865A;&#x62DF;&#x673A;&#x4E2D;&#x7F16;&#x8F91;&#xFF0C;&#x7B54;&#x8FA9;&#x65F6;vim&#x4F7F;&#x7528;&#x7684;&#x719F;&#x6089;&#x7A0B;&#x5EA6;&#x4E5F;&#x5360;&#x4E00;&#x5B9A;&#x7684;&#x5206;&#x6570;&#x3002;&#x4E0D;&#x7528;&#x62C5;&#x5FC3;&#x76F4;&#x63A5;&#x5728;&#x865A;&#x62DF;&#x673A;&#x6539;&#x4F1A;&#x6539;&#x9519;&#xFF0C;&#x56E0;&#x4E3A;&#x6539;&#x9519;&#x4E86;&#x4F60;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;git&#x8FD8;&#x539F;&#xFF08;&#x4E4B;&#x540E;&#x4F1A;&#x8BB2;&#xFF09;&#x3002;&#x5982;&#x679C;&#x4F60;&#x5B9E;&#x5728;&#x4E0D;&#x60F3;&#x7528;vim&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x5728;&#x672C;&#x5730;&#x7F16;&#x8F91;&#x597D;&#x4E4B;&#x540E;&#xFF0C;&#x5C06;&#x4FEE;&#x6539;&#x7684;&#x5355;&#x4E2A;&#x6587;&#x4EF6;&#x4F20;&#x5230;&#x865A;&#x62DF;&#x673A;&#x4E2D;&#x8FDB;&#x884C;&#x8986;&#x76D6;&#x3002;</p>
</div></div></p>
<h2 id="configuring-x-server">Configuring X Server</h2>
<p>We need graphical display after the middle stage of our course so you are supposed to configure it properly.</p>
<p><div class="panel panel-danger"><div class="panel-heading"><div class="panel-icon"><i class="icon-danger"></i></div><div class="panel-title">&#x914D;&#x7F6E; X Server</div></div><div class="panel-content"><p>&#x4F60;&#x9700;&#x8981;&#x6839;&#x636E;&#x4E3B;&#x673A;&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x7684;&#x7C7B;&#x578B;, &#x4F60;&#x9700;&#x8981;&#x4E0B;&#x8F7D;&#x4E0D;&#x540C;&#x7684; X Server:</p>
<ul>
<li>Windows &#x7528;&#x6237;. &#x70B9;&#x51FB;<a href="http://sourceforge.net/project/downloading.php?group_id=156984&amp;filename=Xming-6-9-0-31-setup.exe" target="_blank">&#x8FD9;&#x91CC;</a>&#x4E0B;&#x8F7D;, &#x5B89;&#x88C5;&#x5E76;&#x6253;&#x5F00; Xming.</li>
<li>Mac &#x7528;&#x6237;. &#x70B9;&#x51FB;<a href="http://xquartz.macosforge.org/trac/wiki" target="_blank">&#x8FD9;&#x91CC;</a>&#x8FDB;&#x5165; XQuartz &#x5DE5;&#x7A0B;&#x7F51;&#x7AD9;, &#x4E0B;&#x8F7D;, &#x5B89;&#x88C5;&#x5E76;&#x6253;&#x5F00; XQuartz.</li>
<li>GNU/Linux &#x7528;&#x6237;. &#x7CFB;&#x7EDF;&#x4E2D;&#x5DF2;&#x7ECF;&#x81EA;&#x5E26; X Server, &#x4F60;&#x4E0D;&#x9700;&#x8981;&#x989D;&#x5916;&#x4E0B;&#x8F7D;.</li>
</ul>
<p>&#x5728;&#x865A;&#x62DF;&#x673A;&#x4E2D;&#x5B89;&#x88C5; <code>xclock</code> &#x8FD9;&#x4E2A; X &#x534F;&#x8BAE;&#x6D4B;&#x8BD5;&#x8F6F;&#x4EF6;&#x56FE;&#x5F62;&#x65F6;&#x949F;&#xFF1A;</p>
<pre><code class="lang-bash">sudo apt install x11-apps
</code></pre>
<p>&#x7136;&#x540E;&#x6839;&#x636E;&#x4E3B;&#x673A;&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x7684;&#x7C7B;&#x578B;, &#x4E3A; SSH &#x6253;&#x5F00; X11 &#x8F6C;&#x53D1;&#x529F;&#x80FD;:</p>
<ul>
<li><p>Mac&#x7528;&#x6237;&#xFF1A;&#x5728;&#x8FD0;&#x884C; <code>ssh</code> &#x547D;&#x4EE4;&#x65F6;&#x52A0;&#x5165; <code>-X</code> &#x9009;&#x9879;&#x5373;&#x53EF;:</p>
<pre><code>ssh -X -p 20022 username@ip_addr
</code></pre></li>
<li><p>Windows&#x7528;&#x6237;&#xFF1A;&#x5728;&#x4F7F;&#x7528; <code>PuTTY</code> &#x767B;&#x9646;&#x65F6;, &#x5728; <code>PuTTY Configuration</code> &#x7A97;&#x53E3;&#x5DE6;&#x4FA7;&#x7684;&#x76EE;&#x5F55;&#x4E2D;&#x9009;&#x62E9; <code>Connection -&gt; SSH -&gt; X11</code>, &#x5728;&#x53F3;&#x4FA7;&#x52FE;&#x9009; <code>Enable X11 forwarding</code>, &#x7136;&#x540E;&#x767B;&#x9646;&#x5373;&#x53EF;.</p>
</li>
<li><p>GNU/Linux&#x7528;&#x6237;&#xFF1A;&#x5B89;&#x88C5;&#x6709;&#x56FE;&#x5F62;&#x754C;&#x9762;&#x7684; Linux &#x673A;&#x5668;&#x5E94;&#x8BE5;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x6253;&#x5F00;&#x56FE;&#x5F62;&#x663E;&#x793A;</p>
</li>
</ul>
<p>&#x901A;&#x8FC7;&#x5E26;&#x6709;X11&#x8F6C;&#x53D1;&#x529F;&#x80FD;&#x7684;SSH&#x767B;&#x9646;&#x540E;&#xFF0C;&#x6267;&#x884C;&#x547D;&#x4EE4;</p>
<pre><code class="lang-bash">xclock
</code></pre>
<p>&#x6253;&#x5F00;&#x56FE;&#x5F62;&#x65F6;&#x949F;&#xFF0C;&#x6D4B;&#x8BD5;&#x662F;&#x5426;&#x80FD;&#x591F;&#x6B63;&#x5E38;&#x6253;&#x5F00;&#x663E;&#x793A;&#x3002;&#x6211;&#x4EEC;&#x5728;PA&#x8FDB;&#x884C;&#x5230;&#x4E2D;&#x671F;&#x65F6;&#x4E5F;&#x9700;&#x8981;&#x8FDB;&#x884C;&#x56FE;&#x50CF;&#x7684;&#x8F93;&#x51FA;, &#x56E0;&#x6B64;&#x4F60;&#x52A1;&#x5FC5;&#x5B8C;&#x6210;X Server&#x7684;&#x914D;&#x7F6E;.</p>
</div></div></p>
<h2 id="exporting-your-vm-as-backup">Exporting Your VM as Backup</h2>
<p>You are supposed to make backups of your VM regularly to prevent potential crashes. It is easy to use the function provided by VirtualBox. What you should do is:</p>
<ol>
<li>Run Oracle VM VirtualBox Manager.</li>
<li>Click <code>File</code> in menu bar and click <code>Export Appliance...</code>.</li>
<li><strong>Virtual machines to export.</strong> Select the VM you want to export in the list and click <code>Next</code>.</li>
<li><strong>Storage settings.</strong> Select a save path to save the archive of VM, leaving other settings default and click <code>Next</code>.</li>
<li><strong>Appliance Settings.</strong> Fill in the blanks if you want, or just leaving it default is okay.</li>
<li>Wait until the operation finished.</li>
</ol>
<p>Operations above will pack up everything of your VM as a single file which includes settings and compressed virtual hard disks. When your VM is encountered with any fatal error that makes your VM unable to use, you can import these backups at any time.</p>
<p><div class="panel panel-danger"><div class="panel-heading"><div class="panel-icon"><i class="icon-danger"></i></div><div class="panel-title">&#x517B;&#x6210;&#x7ECF;&#x5E38;&#x5907;&#x4EFD;&#x865A;&#x62DF;&#x673A;&#x7684;&#x597D;&#x4E60;&#x60EF;</div></div><div class="panel-content"><p>&#x6CE8;&#x610F;&#x7ECF;&#x5E38;&#x4F7F;&#x7528;&#x4E0A;&#x8FF0;&#x5BFC;&#x51FA;&#x865A;&#x62DF;&#x673A;&#x529F;&#x80FD;&#x5BF9;&#x865A;&#x62DF;&#x673A;&#x8FDB;&#x884C;&#x5BFC;&#x51FA;&#x64CD;&#x4F5C;&#xFF0C;&#x4EE5;&#x9632;&#x56E0;&#x4E00;&#x65F6;&#x4E0D;&#x614E;&#x5BFC;&#x81F4;&#x865A;&#x62DF;&#x673A;&#x5D29;&#x6E83;&#x65E0;&#x6CD5;&#x6B63;&#x5E38;&#x5F00;&#x673A;&#x6216;&#x8005;&#x7CFB;&#x7EDF;&#x51FA;&#x73B0;&#x95EE;&#x9898;&#x4E22;&#x5931;&#x5927;&#x91CF;&#x5B9D;&#x8D35;&#x7684;&#x4EE3;&#x7801;&#x548C;&#x96BE;&#x5F97;&#x914D;&#x7F6E;&#x597D;&#x7684;&#x5B9E;&#x9A8C;&#x73AF;&#x5883;&#x3002;&#x5BFC;&#x51FA;&#x7684;&#x865A;&#x62DF;&#x673A;&#x5B58;&#x653E;&#x5728;&#x786C;&#x76D8;&#x4E0A;&#x4F1A;&#x6D88;&#x8017;&#x4E00;&#x4E9B;&#x786C;&#x76D8;&#x7A7A;&#x95F4;&#xFF0C;&#x6240;&#x4EE5;&#x7ECF;&#x5E38;&#x4FDD;&#x5B58;&#x4E00;&#x4E2A;&#x6700;&#x65B0;&#x7684;&#x865A;&#x62DF;&#x673A;&#x526F;&#x672C;&#x5373;&#x53EF;&#x3002;&#x4E00;&#x65E6;&#x51FA;&#x73B0;&#x95EE;&#x9898;&#xFF0C;&#x53EF;&#x4EE5;&#x53CA;&#x65F6;&#x5220;&#x9664;&#x51FA;&#x95EE;&#x9898;&#x7684;&#x865A;&#x62DF;&#x673A;&#x5E76;&#x5BFC;&#x5165;&#x526F;&#x672C;&#x3002;&#x5BFC;&#x51FA;&#x64CD;&#x4F5C;&#x662F;&#x76F4;&#x63A5;&#x628A;&#x865A;&#x62DF;&#x673A;&#x8BBE;&#x7F6E;&#x548C;&#x786C;&#x76D8;&#x6253;&#x5305;&#x5B58;&#x50A8;&#xFF0C;&#x91CD;&#x65B0;&#x5BFC;&#x5165;&#x540E;&#x51E0;&#x4E4E;&#x6240;&#x6709;&#x914D;&#x7F6E;&#x548C;&#x865A;&#x62DF;&#x786C;&#x76D8;&#x4E0A;&#x7684;&#x6587;&#x4EF6;&#x90FD;&#x548C;&#x5BFC;&#x51FA;&#x65F6;&#x5B8C;&#x5168;&#x76F8;&#x540C;&#xFF0C;&#x4F60;&#x53EA;&#x9700;&#x8981;&#x91CD;&#x5199;&#x4E0A;&#x6B21;&#x5BFC;&#x51FA;&#x4EE5;&#x6765;&#x90E8;&#x5206;&#x7684;&#x4EE3;&#x7801;&#x5373;&#x53EF;&#xFF08;&#x75AF;&#x72C2;&#x6697;&#x793A;&#x8981;&#x7ECF;&#x5E38;&#x5BFC;&#x51FA;&#x6700;&#x65B0;&#x7248;&#x672C;&#xFF09;</p>
</div></div></p>
<hr>
<p><em>That&apos;s everything in PA0.6.</em></p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="0.5.html" class="navigation navigation-prev " aria-label="Previous page: 0.5 More Exploration">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="0.7.html" class="navigation navigation-next " aria-label="Next page: 0.7 Acquiring Source Code for PAs">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"0.6 Logging in and Transferring Files via SSH","level":"1.3.6","depth":2,"next":{"title":"0.7 Acquiring Source Code for PAs","level":"1.3.7","depth":2,"path":"pa0/0.7.md","ref":"pa0/0.7.md","articles":[]},"previous":{"title":"0.5 More Exploration","level":"1.3.5","depth":2,"path":"pa0/0.5.md","ref":"pa0/0.5.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["panel","-sharing"],"pluginsConfig":{"panel":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"pa0/0.6.md","mtime":"2022-03-02T14:31:25.189Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2022-06-05T09:31:00.205Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

